package day8;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Buyclothes {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String answer = "";
        int c = 0;
        for (int i = 1; i <= 5; i++) {
            System.out.println("进入了第" + i + "家店");
            for (int j = 1; j <= 3; j++) {
                System.out.print("要离开？");
                answer = in.next();
                if (answer.equals("y") || answer.equals("是"))
                    break;
                System.out.println("买了一件");
                c++;
            }
            System.out.println("从第"+i+"家店出来了。还逛？");
            answer=in.next();
            if(answer.equals("no")){
                break;
            }
        }
        System.out.println("总共买了"+c+"件");
    }
}
